package cn.ywsj.ywsjmidtier.controller;

import cn.ywsj.ywsjmidtier.entity.VO.ThOrderListQueryVo;
import cn.ywsj.ywsjmidtier.entity.VO.WarehouseVo;
import cn.ywsj.ywsjmidtier.service.WechatWarehouseFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/wechat/member/wechatwarehousemgr"})
public class WechatWarehouseController {

    @Autowired
    private WechatWarehouseFeign warehouseFeign;

    @GetMapping(value = {"/getordercheckopen"})
    public String getOrderCheckOpen(ThOrderListQueryVo queryVo) {
        return warehouseFeign.getOrderCheckOpen(JsonObjectUtil.ObjectToJson(queryVo));
    }

    @RequestMapping({"/ajaxupdatewarehouse"})
    public String ajaxUpdateWarehouse(WarehouseVo warehouseVo, BindingResult result) {
        return warehouseFeign.ajaxUpdateWarehouse(JsonObjectUtil.ObjectToJson(warehouseVo),result);
    }

    @RequestMapping(value = {"/updatewarehousestatus"}, method = {RequestMethod.POST})
    public String updateWarehouseStatus(WarehouseVo warehouseVo) {
        return warehouseFeign.updateWarehouseStatus(JsonObjectUtil.ObjectToJson(warehouseVo));
    }
}
